import { Router } from 'express';
import UserController from '@/controllers/UserController';
const router = Router();
import { handleSuccess, handleError } from '@/middlewares/requests';
import authVertify from '@/middlewares/auth';

// 注册用户
router.post('/create', UserController.createUser, handleSuccess, handleError);
// 用户登录操作
router.post('/login', UserController.userLogin, handleSuccess, handleError);
// 获取用户信息
router.get(
  '/userinfos',
  authVertify,
  UserController.getUserById,
  handleSuccess,
  handleError,
);

export default router;
